package cn.imvc.app.domains;

import java.util.EnumSet;
import java.util.LinkedHashMap;
import java.util.Map;

//显示类型：
//H5：101轮播图、102商品分类、103广告、104双列类型列表、105单列类型列表
public enum IndexDataType {
    goods(1) {
        public String toString() {
            return "单品";
        }
    },
    GoodsFirstClass(2) {
        public String toString() {
            return "分类列表页";
        }
    },
    GoodsClassList(3) {
        public String toString() {
            return "分类页";
        }
    },
    NewsClass(4) {
        public String toString() {
            return "新闻分类页";
        }
    },
    News(5) {
        public String toString() {
            return "新闻页";
        }
    },
	TypeClass(6) {
        public String toString() {
            return "商品类型";
        }
    },
    Brand(7) {
        public String toString() {
            return "品牌";
        }
    },
    Video(8) {
	        public String toString() {
	            return "视频";
	        }
	    },
    Search(9) {
        public String toString() {
            return "搜索";
        }
    },
	Url(10) {
	    public String toString() {
	            return "URL";
	     }
     };
    private final Byte val;

    IndexDataType(int n) {
        val = (byte) n;
    }

    public Byte getValue() {
        return val;
    }
    public static IndexDataType getByIntValue(int n) {
        switch (n) {
            case 1:
                return goods;
            case 2:
                return GoodsFirstClass;
            case 3:
                return GoodsClassList;
            case 4:
                return NewsClass;
            case 5:
                return News;
            case 6:
                return TypeClass;
            case 7:
                return Brand;
            case 8:
                return Video;
            case 9:
                return Search;
            case 10:
                return Url;
            default:
                return null;
        }
    }
    
    public static final Map<Byte, String> elMap = new LinkedHashMap<Byte, String>();  
  
    static {
        for (IndexDataType s : EnumSet.allOf(IndexDataType.class)) {
        	elMap.put(s.getValue(), s.toString());
        }
    }
}